package cn.edu.hunau.basic.day05;

import org.junit.Test;

import java.util.Arrays;

/**
 * @author hb
 * @date 2025-08-01 10:52:19
 */
public class MemmoryDemo {
    @Test
    public void test01(){
        int a=0;
        int b=1;
        changeValue(a,b);
        System.out.println(a+" : "+b);//0:1

        int [] arr={1,2,3,4,5}; //new int[]{1,2,3,4,5}
        changeData(arr);
        System.out.println(Arrays.toString(arr));//[99, 2, 3, 4, 5]
    }

    public void changeData(int[] arr) {
        arr[0]=99;
    }

    public void changeValue(int a, int b) {
        a=100;
        b=200;
    }
}
